package com.foreknow.demo10;

/**
 * 如果想动态构造字符串就可以使用StringBuffer工具类
 * 常用的方法：append(String s) 追加字符串
 */
public class StringBufferDemo {
    public static void main(String[] args) {
        String sql = "select * from emp";
        StringBuffer stringBuffer = new StringBuffer("select * from emp");
/*        if (title!=null){
            stringBuffer.append("");
        }else if (name!=null){
            stringBuffer.append("");
        }*/
        stringBuffer.append("where ename = abc");
        stringBuffer.append("and sal = 123");
        stringBuffer.append("kkk");
        System.out.println(stringBuffer);
    }
}
